<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
  <title>详情页</title>
  <link rel="stylesheet" type="text/css" href="border.css">
  <link rel="stylesheet" type="text/css" href="reset.css">
  <link rel="stylesheet" type="text/css" href="content.css">
  <!-- <script src="/crNursing/resource/js/jquery-1.9.1.min.js"></script> -->
  <script>
  function test() {
    var missionId = GetRequest()["id"];
	//let missionId = "CFQHLDY-7";
    console.log("请求准备发送id="+missionId);
	console.log("host="+location.host)
	//http://120.224.211.7:61026/crNursing
	/*请求参数*/
	var paramObj = {
		httpUrl : "/crNursing/api/briefMission/getBriefMission/"+missionId+"?App-Token-Nursing=51e827c9-d80e-40a1-a95a-1edc257596e7",
		type : 'get',
	}
	/*请求调用*/
	timedGetText(paramObj.httpUrl,3000,function(respondDada) {
	    //这里编写成功的回调函数
	    console.log("结果=="+respondDada)
		document.getElementById("content").innerHTML = respondDada
	});
    // $.ajax({
    //   type : "get",
    //   url : "http://192.168.8.204:9091/crNursing/api/briefMission/getBriefMission/"+missionId+"?App-Token-Nursing=51e827c9-d80e-40a1-a95a-1edc257596e7",
    //   success : function(result) {
    //     let content=result.data.content
    //     $('.content').html(content);
    //   },
    //   error:function(result){
    //   console.log("error");
    //   }
    // });
  }
  function GetRequest() {   
	  var url = location.search; //获取url中"?"符后的字串   
	  var theRequest = new Object();   
	  if (url.indexOf("?") != -1) {   
	     var str = url.substr(1);   
	     var strs = str.split("&");   
	     for(var i = 0; i < strs.length; i ++) {   
	        theRequest[strs[i].split("=")[0]]=strs[i].split("=")[1]; 
	     }   
	  }   
	  return theRequest;   
  } 
  // (function(){
	 //  test();
  // })();
  window.onload = function (){
        test();
  }
  function timedGetText( url, time, callback ){
      var request = new XMLHttpRequest();
      request.open( "GET", url);
	  //request.setRequestHeader('Access-Control-Allow-Origin', '*')
      request.onreadystatechange = function(){
          if( request.readyState !== 4 ) return;
          if( request.status === 200 ){
              callback( JSON.parse(request.responseText).data.content );
          }
      }
      request.send();
  }
  </script>
</head>
<body>
<div class="content" id="content">
</div>
</body>
</html>